#!/usr/bin/env ruby

def generate(word)
  
  token = "T_" + word.upcase + if word.upcase.length > 4 then "\n" else "" end
  token += "\t:\t"    
  
  word.each_byte do |ch|
    ch = ch.chr
    if ch =~ /[a-zA-Z]/
      up = ch.upcase
      dn = ch.downcase
      token += "('#{up}'|'#{dn}') "      
    end
  end
  
  token[0,token.length-1]
end

ARGV.each do |arg|
  puts generate(arg) + ";"
end
